package com.moonshineproject
{
	import com.moonshineproject.plugin.project.vo.ProjectVO;
	import com.moonshineproject.view.IContentWindow;
	import com.moonshineproject.view.MainView;
	
	import mx.collections.ArrayCollection;
	
	[Bindable]
	public class IDEModel
	{
		private static var instance:IDEModel;
		public static function getInstance():IDEModel 
		{	
			if (!instance)
				instance = new IDEModel();
			
			return instance;
		}
		
		
		// Currently active editor
		public var activeEditor:IContentWindow;
		
		// Array of current editors
		public var editors:ArrayCollection = new ArrayCollection();
		public var projects:ArrayCollection = new ArrayCollection();

		public var mainView:MainView;
				
		public var activeProject:ProjectVO;
		
		public var recentlyOpenedFiles:ArrayCollection = new ArrayCollection();
		public var recentlyOpenedProjects:ArrayCollection = new ArrayCollection();
		
		public function removeEditor(editor:Object):Boolean
		{
			var index:int = editors.getItemIndex(editor);
			if (index > -1)
			{
				editors.removeItemAt(index);
				return true;
			}
			
			return false;
		}
		
	}
}